package com.example.controller;

import com.example.result.CommonResult;
import com.example.service.CommentService;
import com.example.vo.CommentVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.PrimitiveIterator;

/**
 * @BelongsProject："smart-property"
 * @BelongsPackage："com.example.controller"
 * @CreateTime："2022-11-14 19:05"
 * @Description：评论
 * @Author：LK
 */
@RestController
@RequestMapping("/commentController")
public class CommentController {

    @Autowired
    private CommentService commentService;

    /**
     * @description:评论全查、分页、模糊查
     * @author: lk
     * @date: 2022/11/14 19:17
     * @param: commentVO
     * @return: com.example.result.CommonResult
     **/
    @RequestMapping("/commentCleck")
    public CommonResult commentCleck(@RequestBody CommentVO commentVO){
        CommonResult commonResult = commentService.commentCleck(commentVO);
        return commonResult;
    }

    /**
     * @description:删除评论
     * @author: lk
     * @date: 2022/11/15 10:01
     * @param: commentNumber
     * @return: com.example.result.CommonResult
     **/
    @PostMapping("/commentDel/{commentNumber}")
    public CommonResult commentDel(@PathVariable String commentNumber){
        return commentService.commentDel(commentNumber);
    }
}
